package com.Ele_Demo.jackiez.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

//Here i user a mimetype in the database,which is like the data table in the contact.db
public class DBOpenHelper extends SQLiteOpenHelper{
	private static final String DB_NAME = "MyContacts.db";
	private static final int DB_VERSION = 2; 
	
	public DBOpenHelper(Context context) {
        super(context, DB_NAME, null, DB_VERSION);
		// TODO Auto-generated constructor stub
	}
	
    @Override
    public void onCreate(SQLiteDatabase db) {
    	//db.execSQL("CREATE TABLE mycontacts(_id INTEGER PRIMARY KEY AUTOINCREMENT,raw_contacts_id INTEGER,display_name TEXT,data1 TEXT,data2 TEXT,data3 TEXT);");
    	db.execSQL("CREATE TABLE mycontacts(_id INTEGER PRIMARY KEY AUTOINCREMENT,raw_contacts_id INTEGER,my_mimetype INTEGER,data TEXT);");
    	db.execSQL("CREATE TABLE uploadmessage(_id INTEGER PRIMARY KEY AUTOINCREMENT,contacts_account INTEGER,phone_model TEXT,version_sdk TEXT,version_os TEXT,upload_time TEXT);");
    }
    
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
     }
	
}